<div class="search byby">
	<span>请输入毕业的年份：</span><input style="width:150px;" class="search_input" type="text" name="grade"/>
    <select name="major" style="height:25px;">
        <option>-----请选择-----</option>
    </select>
    <select name="iclass">
    </select>
</div>
<hr>
<div style="text-align: center;width:100%;">

<div id="by_result"></div>
<div style="clear:both"></div>
</div>
<script>
	var byby=new PureAjax();
	var grade=document.getElementsByName("grade")[0];
	var major=document.getElementsByName("major")[0];
	var iclass=document.getElementsByName("iclass")[0];
	var j;
	grade.focus();
	byby.post({
		dataType:"json",
		data:{},
		async:true,
		url:URL+"Request/getMajorList",
		success:function(data){
			var length=data.length;
			for(j=0;j<length;j++){
				opt=document.createElement("option");
				opt.value=data[j].code;
				opt.innerHTML=data[j].name;
				major.appendChild(opt);
			}
		}
	});
	j=0;
	major.onchange=function(){
		byby.post({
			dataType:"json",
			data:{getmajor:major.value},
			async:true,
			url:URL+"Request/getClassList",
			success:function(data){
				var length=data.length;
				iclass.innerHTML="";
				for(j=0;j<length;j++){
					opt=document.createElement("option");
					opt.value=data[j].code;
					opt.innerHTML=data[j].name;
					iclass.appendChild(opt);
				}
			}
		});
	}
	iclass.onclick=function(){
		byby.post({
			dataType:"html",
			data:{getby:grade.value,getmajor:major.value,getclass:iclass.value},
			url:URL+"Search/byby",
			success:function(data){
				byby.dealJSinHTML(data,"by_result");
			}
			
		});
	}
</script>